bug fix in connection creation