Added before_filter method to controller