fixed connection dispatching bugs