bug fix for storing db in memory