added check if file didn't exist