fixing glcontext bug