fixed bug regarding indices to exclude