Check for valid fd first.