updated for mongoose