controller global scope method before exit