fix up before_filter and add specs for it