add before_filter function and modify indent