encode data before saving to db
same for logs too