Correct bug of going off the screen on the right side