in order to work around the crashes in bug #673264 and bug #674108. (cherry picked from commit c1786fe7)