fix code
Exception check