check if device is undefined