fix typo that cause memory leak