changed device checking to more familiar syntax