issue 9 : Improved error handling"