fixed bugs in bubble_sort