replaced panic with t.Fatal