Merge branch 'master' into production
better escaping and error handling