grad- fixed undefined issue, again