add closure function