Do not allow nil length and close device