fix optim example