More resilient on connection lost
Fix bug on create_new_log