improve error handling
Merge branch 'master' into production