fixed script to take chef environment param