added recursive type check and unsound declarations