fix bug that caused a stop before the end of the screen