fix bug on GL viewer