issue #10 - implemented returnObject option