fix detail
sort function