Sorry to hear this. Maybe you can feel comfort in knowing you were there with him and depending on the situation, he knew loved ones were there with him.
Many people don't get this opportunity. I hope you can have peace in your heart soon, and always remember the positive in the life he lead and had with you, however much it was.