New fix for problem with spaces in query