fixing the click detection problem