moved try catch