fix exception catching;