change to use CC_SAFE_RELEASE_NULL and CC_SAFE_RETAIN