Fixed bugs, added event for disconnected trapdevices