updating the history functionality to be able to navigat through history