clearSelection undefined fix