Fix connection lost bug (dont try to write to disk)