How do I prevent crashing every time I choose a texture?