Now it detects when the mouse goes outside the field!
Detects and store when mouse goes out of the field