Removing the dismiss event function for mouse events