Fixed recursive call bug