adding automation code