fix puppet script bugs