Remove deprecetaed function. Started using new api