changed API - fix #1