added exceptions support