Fix for exception on creating existing file