updated example
clean code
updated websocket global events