added grade validation to setgrade