fixed the errors on using undecleard variables by replacing metafunctions with judgments