Add remember cursor function