implemented local db state saving for future web front end interface to use