diff --git a/lib/geocoder/stores/active_record.rb b/lib/geocoder/stores/active_record.rb
index <HASH>..<HASH> 100644
--- a/lib/geocoder/stores/active_record.rb
+++ b/lib/geocoder/stores/active_record.rb
@@ -213,8 +213,8 @@ module Geocoder::Store
           bearing = false
         end
 
-        distance = approx_distance_from_sql(latitude, longitude, options)
         options[:units] ||= (geocoder_options[:units] || Geocoder::Configuration.units)
+        distance = approx_distance_from_sql(latitude, longitude, options)
 
         b = Geocoder::Calculations.bounding_box([latitude, longitude], radius, options)
         conditions = [
fixed unit config not working with sqlite distance