fix base cases