use strict mode in js and add some missing semicolons