fixed mongo integration bugs