some exception handling tweaks