fix global search function