Fixed a bug which cause javascript in widget page to freeze