clean up the return value of a function