undefined exception fixes