fixed bug in API