bugfixing opengl errors