Fixed out of memory exception for overlay.