reduce memory leak when runned on PHP 5.1