Fix bug when file does not exist