add state code for servicedef