updated condition for figure renaming