Fixed variable not defined error.