trying to get the retval in wrapper function working