working on fixing r2 for new db structure