add clear logic