Add AppInit, fix close button