fix for some corner cases