fix UnicodeDecodeError when creating device fails