Added check not to paste into invalid parents