fixed delete step function