fixed bug in onDBChange()