A method for controlling a wind turbine connected to a utility grid, the wind turbine comprises rotor blades, the method comprising: detecting a fault of the utility grid; controlling one or more rotor blades in a fault mode; detecting a recovery of the utility grid; controlling during a recovery period, one or more rotor blades in a recovery mode, wherein the recovery mode comprises: determining an actual pitch angle of each of the rotor blades; determining an actual wind speed (ws); determining a desired pitch angle of each of the rotor blades according to the actual wind speed; determining a pitch ramp rate of each of the rotor blades so that the actual pitch angle match the desired pitch angle before the end of the recovery period, and ramping the pitch angle of each of the rotor blades with the determined pitch ramp rate; characterized in that the method further comprising: determining a desired output power of the wind turbine according to the actual wind speed; determining a ramp rate of the output power so that the output power match the desired output power before the end of the recovery period, and ramping the output power with the determined ramp rate wherein the ramp rate of the output power and the pitch ramp rate are aligned so that the output power reaches the desired output power at the same time the pitch angle reaches the desired pitch angle. detecting a fault of the utility grid; controlling one or more rotor blades in a fault mode; detecting a recovery of the utility grid; controlling during a recovery period, one or more rotor blades in a recovery mode, wherein the recovery mode comprises: determining an actual pitch angle of each of the rotor blades; determining an actual wind speed (ws); determining a desired pitch angle of each of the rotor blades according to the actual wind speed; determining a pitch ramp rate of each of the rotor blades so that the actual pitch angle match the desired pitch angle before the end of the recovery period, and ramping the pitch angle of each of the rotor blades with the determined pitch ramp rate; characterized in that the method further comprising: determining a desired output power of the wind turbine according to the actual wind speed; determining a ramp rate of the output power so that the output power match the desired output power before the end of the recovery period, and ramping the output power with the determined ramp rate wherein the ramp rate of the output power and the pitch ramp rate are aligned so that the output power reaches the desired output power at the same time the pitch angle reaches the desired pitch angle. determining an actual pitch angle of each of the rotor blades; determining an actual wind speed (ws); determining a desired pitch angle of each of the rotor blades according to the actual wind speed; determining a pitch ramp rate of each of the rotor blades so that the actual pitch angle match the desired pitch angle before the end of the recovery period, and ramping the pitch angle of each of the rotor blades with the determined pitch ramp rate; characterized in that the method further comprising: determining a desired output power of the wind turbine according to the actual wind speed; determining a ramp rate of the output power so that the output power match the desired output power before the end of the recovery period, and ramping the output power with the determined ramp rate wherein the ramp rate of the output power and the pitch ramp rate are aligned so that the output power reaches the desired output power at the same time the pitch angle reaches the desired pitch angle. determining a desired output power of the wind turbine according to the actual wind speed; determining a ramp rate of the output power so that the output power match the desired output power before the end of the recovery period, and ramping the output power with the determined ramp rate wherein the ramp rate of the output power and the pitch ramp rate are aligned so that the output power reaches the desired output power at the same time the pitch angle reaches the desired pitch angle.