Created method to get a valid file name.