workable when both showing UI and receiving data from socket