Fix for javascript to check all sub scopes on check of parent