socket messages functional