File creation bug fix