fix torec to work with new api