If two consecutive states are the same the similar state is not saved