fixing fd code