add sort to base model, fix tests