Fiddled with state handling.