Original: When he was appointed to the post of Secretary of War in 1814, he stayed on as the Secretary of State ad interim.
Simplified: Monroe was Madison's Secretary of State and Secretary of War.