new version with callback for unselect