bug fix in api