Added start of socket timeout and cleanup