because when it was ajaxifyed the .js.erb file was passed by and therefore some params there were set which were called in the .js file however after unajaxifying it the .js.erb wasn't passed by initially so all these variables were not instantiated so there had to be a class variable which will be set by the param sent from the link to