additional error handling for ShowErrors function