fix retain/relase cast bug.