updated API, should works fine