modified undo to stay on same page