fix bugs of empty grade