fixed crash for new file creation