fix #94 check for invalid devices