rework try/catch block