Properly uri encode query