added check_mouse function