Fixed error using sort instead of order