search works but buggy