correctly handle exceptions