Add function to get selected text