check sorted