fix getIndex method in note controller