Fix the memery leak