Fix rename function: if no tag selected