refine try catch