fixed missplaced grad