added checking for parent gateway