sort both direction and filter