make modal dependant on lack of parent instead of existence of children