Handling changes in the application state