made checking for yaml errors better