better mongo connection, added update to mongo_insert