fixed coffeescript conversion