Moved onMouseEnter and onMouseLeave outside of loop