more robust export