fix for collection.sort exception