Changed nil test for states to newState since it was incorrect