before_filter for posts and flash notice