Fixed error in state::run