bug fixes and add missing JS file