fixing issue of duplicate notes