link and clean up