Completed manage the state of the back and forward buttons