note insertion bugfixes