finish step function