added multiple connection support