Change exception logic for nulls