adding timeout for opening connections