The correct order is the following.
1.- Secretary of the Treasury
2.- Secretary of defense
3.- Attorney general
If the president should die or become unable to fulfill his role, the correct order of those listed below in the line of succession would be the following: Secretary of the Treasury, Secretary of Defense, Attorney General.
If for whatever reason the President of the United States dies, is impeached or resigns, the officials of the US government that would assume the executive power will be the following: the Vice president would be the first in line, then the Speaker of the House followed by the President pro tempore of the Senate, and then the members of the Cabinet, being the first one the Secretary of State.