Periodic table script condition issue

Hi, I’m having issues with conditions check with my bash script in the build-a-periodic-table-database project of Relational Database Curriculum.

So I did a conditional check of arguments with if’s and elif’s but the program only executes the first instruction even if conditional check is false.
Here is my code :

#! /bin/bash
PSQL="psql -X --username=freecodecamp --dbname=periodic_table --tuples-only -c"
EXIT(){
  exit 0
}
ARG1=$1
MAIN_FUNCTION(){
  ## get all informations
  COMPLETE_DATABASE_QUERY=$($PSQL "SELECT * FROM properties FULL JOIN elements USING (atomic_number) FULL JOIN types USING (type_id) ORDER BY atomic_number")
  if [[ "$ARG1" ]];
    then
    
      if [[ $ARG1 =~ ^[0-9]+$ ]];
        echo -e 'arg is int'
        then
          echo $($PSQL "SELECT * FROM properties FULL JOIN elements USING (atomic_number) FULL JOIN types USING (type_id) WHERE atomic_number = '$ARG1' ORDER BY atomic_number")| while read TYPE_ID BAR ATOMIC_NUMBER BAR TYPE BAR ATOMIC_MASS BAR MELTING_POINT_CELSIUS BAR BOILING_POINT_CELSIUS BAR SYMBOL BAR NAME BAR OSEF
        do
          echo "The element with atomic number $ATOMIC_NUMBER is $NAME ($SYMBOL). It's a $TYPE, with a mass of $ATOMIC_MASS amu. $NAME has a melting point of $MELTING_POINT_CELSIUS celsius and a boiling point of $BOILING_POINT_CELSIUS celsius."
        done
      
      elif [[ $ARG1 =~ ^[a-zA-Z]+$ ]];
        echo -e 'arg is name'
        then
          echo $($PSQL "SELECT * FROM properties FULL JOIN elements USING (atomic_number) FULL JOIN types USING (type_id) WHERE name = '$ARG1' ORDER BY atomic_number")| while read TYPE_ID BAR ATOMIC_NUMBER BAR TYPE BAR ATOMIC_MASS BAR MELTING_POINT_CELSIUS BAR BOILING_POINT_CELSIUS BAR SYMBOL BAR NAME BAR OSEF
        do
          echo "The element with atomic number $ATOMIC_NUMBER is $NAME ($SYMBOL). It's a $TYPE, with a mass of $ATOMIC_MASS amu. $NAME has a melting point of $MELTING_POINT_CELSIUS celsius and a boiling point of $BOILING_POINT_CELSIUS celsius."
        done
      
      elif [[ $ARG1 =~ ^[A-Za-z]{,2}$ ]];
          echo -e 'arg is symbol'
        then
          echo $($PSQL "SELECT * FROM properties FULL JOIN elements USING (atomic_number) FULL JOIN types USING (type_id) WHERE symbol = '$ARG1' ORDER BY atomic_number")| while read TYPE_ID BAR ATOMIC_NUMBER BAR TYPE BAR ATOMIC_MASS BAR MELTING_POINT_CELSIUS BAR BOILING_POINT_CELSIUS BAR SYMBOL BAR NAME BAR OSEF
        do
          echo "The element with atomic number $ATOMIC_NUMBER is $NAME ($SYMBOL). It's a $TYPE, with a mass of $ATOMIC_MASS amu. $NAME has a melting point of $MELTING_POINT_CELSIUS celsius and a boiling point of $BOILING_POINT_CELSIUS celsius."
        done
      
      else
        echo -e 'arg is invalid'
        MAIN_FUNCTION "Please provide with a valid argument"

      fi 
    
  else
    echo "Please provide an element as an argument."
    EXIT
  fi
}


MAIN_FUNCTION

and here is an output

codeally@a9a5092f2299:~/project/periodic_table$ ./element.sh Helium
arg is int
ERROR:  invalid input syntax for type integer: "Helium"
LINE 1: ... JOIN types USING (type_id) WHERE atomic_number = 'Helium' O...
                                                             ^
The element with atomic number  is  (). It's a , with a mass of  amu.  has a melting point of  celsius and a boiling point of  celsius.