add risk constraint to optimization problem