added error catching if mouse pointer goes out of the axis