Fix mobile detect set TEMPLATE DIRS
entered in loop