close mongo connections when not in use