Fixed bug with click handling