Fixed bug with selecting history