Function addDevice