some small changes to exception handling