fixed isSelectionCorrect method