fix client state tracking and request complete handling