fixed sqlite db bug