Updated joinServer function