Added automatic selection of prefix for the selected item