fix bug, add python interface