added before filter and some routing