Added js for improved back and forward buttons