update code (add handler for rec button)