Removed term.clear(); it was accidentally added back