# modifyClass gives TypeError undefined?

**URL:** https://meta.discourse.org/t/modifyclass-gives-typeerror-undefined/241896
**Category:** Development
**Created:** [October 14, 2022, 4:21am UTC](https://meta.discourse.org/t/modifyclass-gives-typeerror-undefined/241896 "2022-10-14T04:21:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)
#### Post date: [October 14, 2022, 4:21am UTC](https://meta.discourse.org/t/modifyclass-gives-typeerror-undefined/241896/1 "2022-10-14T04:21:53Z")

</div>

I’m creating a theme component. I have this in the header:

```plaintext
<script type="text/discourse-plugin" version="0.8">

    api.modifyClass("model:post-stream", { 
        pluginId: 'test',
        appendMore: function() {
            this._super();
            console.log("append");
        }
    });

</script>

```

I want to override `appendMore` and which add posts to the post stream as you scroll. It seems it are being properly overridden as the console is logging as expected. There are two issues though:

1. this error is showing up in the console and I don’t want it to 🙃

> Uncaught TypeError: postStream.appendMore() is undefined

1. I am not altering the functionality yet but adding this line of code significantly slows posts being loaded in. Where is this extra time overhead is coming from?

Thanks in advance!
