replaced panic with log.Fatal