fixed bug in db