@OnMessage
    public String onMessage(String message, Session UserSession) throws IOException {
        username = (String) UserSession.getUserProperties().get("username");
        Iterator<Session> iterator = chatroomUsers.iterator();

        if (username == null) {

            UserSession.getUserProperties().put("username", message);
            UserSession.getBasicRemote().sendText(buildJsonData("System", "You are now connected as " + message));
            while (iterator.hasNext()) {
                (iterator.next()).getBasicRemote().sendText(buildJsonUsername());
            }
        } else {
            long msgTime = d.getTime();

            arrayListMessage = msgTime + "#$%" + username + "#$%" + message;
            while (iterator.hasNext()) {
                iterator.next().getBasicRemote().sendText(buildJsonData(username, message));
            }
            UserSession.getBasicRemote().sendText(buildJsonUsername());
            //make entries in DB for received message
        }
        return null;
    }