add a simple func for checking valid mouse clicking