fix bug by adding history element