Added in device checking before calling register function