Fixing a bug in search feature