Added code for automation