adding filter and sort hooks