error handling when setting overlays closes #592

if there was nothing before an overlay section (e.g. search input bar) then we always got an exception instead of setting the overlay.