change states type from uchar to volatile uchar