Revert "Revert "made theme loop""

This reverts commit 4c1fd152f50b542feb44da3bc3a3e357a83297a3.