updated cookbook

with file replacement stop conditions