Added yaml exception handling