fixed for new db structure 2