some changes in exception handling