updated yaml writing