keep selected uid after rewrite