invert device check logic