fix issue when creating a new file