added mongoose code