fixed undefined color context and gfx glitches