quick improvements for error handling