fix search function(more pleasant)