improved close parent behaviour