Now socket is defined in app/main.js
Only emit message if successful