Added check for parent