handling states.