updated with before_filter