added hustory substring search