fixed bug in resolveObj function