fixed the mmeory reused problem