fix chooseName fn and add socket