closed function end