diff --git a/lib/ticket_evolution/core/connection.rb b/lib/ticket_evolution/core/connection.rb
index <HASH>..<HASH> 100644
--- a/lib/ticket_evolution/core/connection.rb
+++ b/lib/ticket_evolution/core/connection.rb
@@ -40,7 +40,7 @@ module TicketEvolution
       @url ||= [].tap do |parts|
         parts << TicketEvolution::Connection.protocol
         parts << "://api."
-        parts << "#{@config[:mode]}." unless @config[:mode] == :production
+        parts << "#{@config[:mode]}." if @config[:mode].present? && @config[:mode].to_sym != :production
         parts << TicketEvolution::Connection.url_base
       end.join
     end
diff --git a/spec/lib/ticket_evolution/core/connection_spec.rb b/spec/lib/ticket_evolution/core/connection_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/ticket_evolution/core/connection_spec.rb
+++ b/spec/lib/ticket_evolution/core/connection_spec.rb
@@ -122,6 +122,12 @@ describe TicketEvolution::Connection do
   end
 
   describe "#url" do
+    context "mode is blank" do
+      subject { klass.new(valid_options.merge({:mode => nil}))}
+
+      its(:url) { should == "https://api.ticketevolution.com" }
+    end
+
     context "production" do
       subject { klass.new(valid_options.merge({:mode => :production}))}
a blank mode doesn't generate a 'api..ticketevo.com' URL