added some mongoose code