I added the event to create rectangles on mouse click.