Fixed JS loading order