fixes setting current state

cc @matallo