Removed code that has NPE depending on application state