adding mouse leave event to prevent unnecessary scrolling