Fix bug
Apply new API