I have the following code to loop through a question session with a user:

```
#loop counter
COUNTER=1

# Initial question

echo ""
echo -n "Would you like a cup of tea? (y/n)" # Ask initial question
read answer # Check answer

while [ $COUNTER -le 5 ] # while counter is less than or equal to 5

do
        if [ "$answer" != "${answer#[Yy]}" ]; then # if answer is 'y'
                echo "" # skip a line for cleanliness
                echo "Great, I'll make it now" # Satisfaction
                echo ""
                break # End the loop
        else # if answer is anything other than 'y'
                echo "" # skip a line for cleanliness
                echo -n "Are you sure? (y/n)" # Ask again
                read answer # Check the answer again
                let COUNTER=COUNTER+1 # increment COUNTER
        fi

done # finish

```

The code should act as follows:

1. Ask user if they would like tea.
2. If user says yes, then print out something, and end loop
3. If user says no, go for another 4 attempts before ending loop.
4. If user says yes, after saying no, print out something, and end loop.

The code works fine for points 1,2, and 4.
On point 3 - the code loops to a 5th loop before ending.

I can't seem to be able to identify the error.

Edit: Changed to COUNTER = 0, and $COUNTER -le 4. However, code doesn't implement point 4, on 4th attempt (i.e. 1 initial no, followed by 3 extra nos, before a yes).