Added timeout to connect operation