Updated stateExists() to be public.