spaces in query issue fixed