Function getSelection