nil class for prev var in controller template bug fixed'