model checkgrad enhancement