To avoid getting an error, first check if an element is in a set before removing it, like with "History" here.
in
"History"
Make sure to pick if followed by "History" and then in, classes:.
if
classes: