changed <= in search check to <