Updated archive functionality and save log to text