Client side js written for messages and senders