improving handling of selections
fixing logic error
adding support for listener for double clicks on items