added socketio and various changes