Fix connection bug