tweaks to exception handling