minor changes
return result:null when ctx.retval is undefined.