fixed script loading order