improved search function to use match keywords