fix a bug for textures cache