fix state controller bug