Added check for duplicate log creation