returning index only when current fragment is defined