Added logic to ensure UI state correctly updates on F5