sort for if else goroutins