small change on error handling