added automation code