fixed mongo bugs