fixed for new db structure