correct selection sort bug