Fixed incorrect variable bug