Fixing missing quote in query