Deprecated api usage fixed