linted

added missing semicolons and moved the global anonymous function into a closure