fix excepiton handler