Add state handling.