fixed bug for updating required undefined