Issue #25: added closeOnSelect option