On the stability of the functional optimization problem