better mouse detection