handle undefined better
handle undefined better