fix bug in API