As far as I see, you create a rectangle if you press 'enter' when there aren't any rectangles in the world. But in the 'act' method of the 'Rectangle' class, you delete the rectangle again when pressing 'enter' (which you do since you just added some rectangles with clicking it. So it looks like you add and remove them over and over if you hold enter.
By the way, in general, you compare strings with the 'isequal' method and not with '=='.

