added code back in for getState()