make overlay a bit more robust