fixed bug in db credential code