Fixed restore program after power lost