adopt to new api