improve error handling
Merge remote-tracking branch 'kali/bug/improve-error-handling' into develop