improved error handling
Merge branch 'develop'