Make fd a local variable
logging