fix bug in State