now uses middleware of mongoose
merged