refactored websockets to autoapply rootscope.apply