fix for error reply
improve code, add 'log' method, add 'all' event
Merge branch 'develop'