clean up main FD loop