fixed connectasserver and connecttofriend, taking in arguments