added exceptions on errors