no need to use local(); we can just close device at the exit time