fixed the code that limits the number of recent searches