flipped error handling order