fixed texture handling