fixed index errors, would crash collection