fix bugs and upgrade js engine