fix bug wrt multiple parents