replace that with a callback, and add a small corruption check