fix db bug