Removed some useless code in getState.