fix ot the getNumOfState function