added find parent indode helper function