Add js alert confirmation on state change