fixed an API call bug