add error when target is not defined.