add Database.Write and Database.Close methods