improved click handling