Fixing double template loading issue