bug fix to prevent gl errors