better selector detection