rewrite getObject function