smoother error handling