fixed getCurrentIndex