Added working notifyStateChange