fixed minor bug in index extraction