fix the connection problem for single pattern