fixes error in before_filter