upgraded the way excpetions are dealth with