Added stabilize function