Fixes a context issues with socket.io on events.