fixed to use the new python interface