adjusting exception handling