I have added an array containing string values in my programme where I want to add an else statement so that if someone enters a value that is not contained in the array, in would print out a message `invalid entry`.

I have written this in the programme but if a correct value is entered the invalid entry still appears when I run the code. 

Enter your name
barry
you are verified you may use the lift

Invalid entry

Invalid entry

Invalid entry

This is what I get 

```
import java.util.Scanner;

public class Username

{
public static void main (String[]args)
{

    Scanner kb = new Scanner (System.in);
    // array containing usernames 
    String [] name = {"barry", "matty", "olly","joey"}; // elements in array

    System.out.println("Enter your name");
    String name1 = kb.nextLine();
    for (int i = 0; i < name.length; i++) {
        if(name[i].equals(name1)) {
        System.out.println("you are verified you may use the lift");
        }else{System.out.println ("Invalid entry");
    }
}

```