Updated script for new HA version