Working code that picks up building DB on restart