Created setSelection method