Fix order of scripts loading