fix error in contract_type search