fixed wrong variable error in logdb