fixing WebGLGraphics bugs with memory