fixed bad variable assignment