add closure variable check