check stream length before searching