fix exception handle