Adding timeout option to catch dead connections