fixed serious memory leak