fixed index bug in sieve