add tail call optimization support