Fix bug where modSchema() wasn't getting called properly on sanity check error

The part of the code which does `modSchema()` was never getting called