moved linking to try/catch block