He did this to avenge the defeat at Badr.