bug fix in connection