<Tr> <Td_colspan="8"> Erin tries to make the annual Halloween party spooky and non-childish, with help from Gabe Lewis (Zach Woods). Dwight becomes friends with Robert's son (David Mazouz), and Pam and Jim debate the existence of ghosts . Meanwhile, Robert tries to figure out everyone's deepest fears in order to culminate the party with a specially - tailored ghost story . </Td> </Tr> <Tr> <Th> 158 </Th> <Td> 6 </Td> <Td> "Doomsday" </Td> <Td> Troy Miller </Td> <Td> Daniel Chun </Td> <Td> November 3, 2011 (2011 - 11 - 03) </Td> <Td> 8003 </Td> <Td> 6.15 </Td> </Tr> <Tr> <Td_colspan="8"> In order to improve efficiency, Dwight installs a Doomsday device that will send an email to California and suggest the closing of the branch . After the maximum number of mistakes is made on the first day, the email is sent but the office works to counteract it; Jim is sent to distract California, whereas Pam--among others--attempts to talk Dwight into dismantling his machine . Meanwhile, Gabe attempts to court the new warehouse worker, Val (Ameenah Kaplan). </Td> </Tr> <Tr> <Th> 159 </Th> <Td> 7 </Td> <Td> "Pam's Replacement" </Td> <Td> Matt Sohn </Td> <Td> Allison Silverman </Td> <Td> November 10, 2011 (2011 - 11 - 10) </Td> <Td> 8007 </Td> <Td> 5.96 </Td> </Tr>

Who takes over for steve carell on the office