add closure sample code