Somalia, Uganda thwart terror attacks in their capitals