Fix for System out of memory exception when exporitng site