fixed glitch in clicking logic