updated pins.controller to before_filter