fix javascript load ordering