Fixes crash when search contains spaces