implement save and restore cursor operations