fixed an memory leak