fixed memoery leak