diff --git a/lib/arduino_firmata/arduino.rb b/lib/arduino_firmata/arduino.rb
index <HASH>..<HASH> 100644
--- a/lib/arduino_firmata/arduino.rb
+++ b/lib/arduino_firmata/arduino.rb
@@ -29,21 +29,8 @@ module ArduinoFirmata
       sleep 3
       @status = Status::OPEN
 
-      trap 'SIGHUP' do
+      at_exit do
         close
-        exit
-      end
-      trap 'SIGINT' do
-        close
-        exit
-      end
-      trap 'SIGKILL' do
-        close
-        exit
-      end
-      trap 'SIGTERM' do
-        close
-        exit
       end
 
       @thread_status = false
use at_exit insteadof trap "SIHUP/SIGINT", suggested by @odarriba  #<I>