Somali pirates have hijacked nearly 40 ships this year .