disconnect cleaning logic