added support for single and multiple selection.