change mouseEvent funtion