Fix the name of database written

Now the db is read from the variable in main
Add the UI REPL