Modified how selected text is gotten