cover device assigning with tests and fix