handle undefined chaincode