Updated the template with mongoose