updateCurrentState() method added - it will be executed if a transition changes the state so that the new state will be executed instantly
Small bugs fixed