corrected an edge case that caused a screen flicker