fix issue with needing optimization toolbox

we don't really need the optimization toolbox, so only use it if it is
present