Fixed implementation of selection. Added jQuery custom event trigger on selection.