Add case states in main loop