check invalid trait reference