added exception catcher