fixed issue with sort option, moved filtering code down into collection