added functionality for saving/loading db