issue #140; some changes in db structure