write to log.txt