added exceptions try/catch blocks