Exception causes notice with undefined property