added socket connection server side and redoing some socket stuff app side