fix for sort - issue #139