call $apply to process the websocket messages