Fixed StateManager issue (To be Optimized = too slow)