handle all sorts of edge cases that would otherwise break UI or functionality