fix func tail