fixed unexpected behavior with updating grades