fixed JS load sequence bug