try catch in wrong place