prevent invalid releasing memory