fix bug in selection