add socket and email stuff