improve mouse detection