fix obsolete api & method