remove function's tails