fix the reload bug
http://stackoverflow.com/questions/17317816/rails-javascript-only-works-after-reload