Trying without the optimize function call