corrects the filename to lose its extension