fixed some bugs in DBContract
fixed some bugs in DBContract