Added selected logic