bug fix in connection::connect