Add recording code.