fixed a bug that prevented the controller from loading defined types by ForeignId