Improved log
Fix a bug in sending events