Updated for Cocos2.1