error handling for device registration
merge kevin stuff resolve