add setState method