diff --git a/lib/reqres_rspec.rb b/lib/reqres_rspec.rb
index <HASH>..<HASH> 100644
--- a/lib/reqres_rspec.rb
+++ b/lib/reqres_rspec.rb
@@ -15,19 +15,14 @@ if defined?(RSpec) && ENV['REQRES_RSPEC'] == '1'
 
   RSpec.configure do |config|
     config.after(:each) do |example|
-      if defined?(Rails)
-        meta_data = self.class.example.metadata
-
-        if meta_data[:type] == :request && process_example?(meta_data, example)
-          begin
+      meta_data = self.class.example.metadata
+      if meta_data[:type] == :request && process_example?(meta_data, example)
+        begin
+          if defined?(Rails)
             collector.collect(self, example, self.request, self.response)
-          rescue NameError
-            raise $!
+          elsif defined?(Sinatra)
+            collector.collect(self, example, self.last_request, self.last_response)
           end
-        end
-      elsif defined?(Sinatra)
-        begin
-          collector.collect(self, self.last_request, self.last_response)
         rescue Rack::Test::Error
           #
         rescue NameError
fix regression with sinatra rspec