added undefined to function closure