Add onClosing method to app