Fixed bug where DB was not saving