fix the memeory issue