return by value bug eliminated