fixed incorrect variable assignment