Fixed a bug in JS, and added some logging information in go file.