fixing gl bug