Fixed javascript to work together with turbolinks