Fixing errors and downgrading to a better mongoose version