modified for puppet 3.6