fixed wrong output register in function call