added before filter to reg controller