Added some functions used for mouse events