parsing and writing to yaml correctly