Issue 2 error changing theme not reflected

Back porting solution from dotCMS/core#6585