more defensive parsing