outer object not passed to inner function