fixed screen flashing on resize