Updated code to fix themes bug