fixed a bug where no external js files would cause a crash