Added a context to create the file in. Therefor I also added on line 30 an extra if, to be able to nullify the prop argument.