fix the order to load scripts