fix memery leak