corrected the wrong state-change