don't erase fd before using it during close