close connect when logout in background