fix mouse logic