make sure index is set to zero