updated initializationState and added state chnage smarts