Updated db to handle circular reference