fix mistake with retval === undefined