Updates search function (working)