Fixing a bug in click handler.