Fix socketio and add some hooks