changed to use mongoose