State handling implemented.