fixed 'space' and state 6 to 0 bug