Adding support for tail segment cleanning