This can be moved into the above if condition - as the theme has to be set only if it is changed.