fix a upvalue problem if using values from an array