fixed state change issue