fixed usage of deprecated apis