added exceptions in the place of error messages