fixed return pointer for multiple returns in a function