fixing integrity errors