fix the ReferenceErrors due to missing types/identifiers