small bug with fold detection indices