finally found the bug, n_out=2 was the solution, not 1