correct delete stage function