modified to work with puppet 3