fixed a tiny uninitialized variable bug in the optimization