-Adding control on warnDeviceSecurityStateChange in order to check if
the device is registered in the database