Added functionality to detect list selections