$apply in socket.on