fixed a bug where the click event for the background rectangle was not recognized correctly