added mongoose and logging