use with defer.