attach handlers to back and forward buttons