converted panic to log.Panic.