Sort function does not work properly