fix rendering glitches