fine tune exception handling