changed to global socket events