Added code around the start function in sockets.