You are assuming that `$value` is an array here.