fix exception check