fixed error with creating the return value, which has to be added as a variable before it can be set