added check for maximum number of texture coordinates