Timeout on connection

Added timeout on connection. It's very critical for me.