I think I fixed all the manual memory alloc