bad practices with my own code. update add function for note indexer