modify a bug of the smith-waterman extension function