How to solve the issue of assigning a device to a user