update with the new api
don't mixup integer and double
merge from master