fix mongoose bugs