bug fix for invalid texture number