add getState method