Fix script behaviour when file does not exist