Added recursion check for objects