re-added line clear logic