Fix: only error if value is undefined