added -wait to consul-template