Fixed JS loading bug