Added stream count check