fixed bug: crashing when opening a new file with the same textures