properly handle clicks