improved execepition handling