fixed some bugs in state
changed imports