fix check undefined