added replace state changes