Tweaked the script to target remote instances