Fixing issues in assigning devices