deal with incomplete input buffer
	modified:   step