tweaks to avoid edge cases