Improve addNote

Now it adds the noteId to user’s history