fix bug where parent was incorrect