fix mongoose unique index handling