add recording code