fixing selector logic