added targetDocument validation