moved try/catch further up.