change the coffeescript to javascript