fixing issue with parent_id assignment not working