better empty case handling