fix gl flush assertion