fixed wrong unbinding query and now real_depth is updated when a node is moved to another ancestor