Made changes for storing only unique logs in db