Fix uses of  Undefined variable: value (you're not in a loop)