Use singleton to avoid db corruption.