diff --git a/examples/hello_schema/main.go b/examples/hello_schema/main.go
index <HASH>..<HASH> 100644
--- a/examples/hello_schema/main.go
+++ b/examples/hello_schema/main.go
@@ -57,16 +57,17 @@ func main() {
 	}
 
 	// File for your new BoltDB. Use path to regular file and not temporary in the real world
-	tmpfile, err := ioutil.TempFile("", "example")
+	tmpdir, err := ioutil.TempDir("", "example")
 	checkErr(err)
 
-	defer os.Remove(tmpfile.Name()) // clean up
+	defer os.RemoveAll(tmpdir) // clean up
 
 	// Initialize the database
-	graph.InitQuadStore("bolt", tmpfile.Name(), nil)
+	err = graph.InitQuadStore("bolt", tmpdir, nil)
+	checkErr(err)
 
 	// Open and use the database
-	store, err := cayley.NewGraph("bolt", tmpfile.Name(), nil)
+	store, err := cayley.NewGraph("bolt", tmpdir, nil)
 	checkErr(err)
 	defer store.Close()
 	qw := graph.NewWriter(store)
hello_schema: replace TempFile with TempDir

If TempFile is used cayley.NewGraph complains about
tmpfile.Name() not being a dir.