moved SelectAll function