Minor changes to prevent Multiple TCP connections