add function on DeviceInfo mongoose model