FIX: I fixed the memory management issues