now removing the application when page is removed.