better error handling when yaml load fails