refactoring
fixed wrong state jump