fixed indexing issue for haar map