fix for texture creation in secondary thread