Check if file does not exist before replacing timestamp in filename