some more updates to get this working with a local in memory database