resolve malloc issue