bug fix on reset db