Pass a reference to the optimizer to the ready callback function