(fix) catch undefined and null expections