changed solution for sorting template in Dropdown