Creating objects bug??

I wanna spawn an enemy, if I do it like this everything works fine:


                        if(a>=10 && a<=80) golom = new Enemy(1);
                       else if(a>80 && a<=100) golom = new Enemy(2);
                       else if(a>=0 && a<10) golom = new Enemy(3);                        
                        enemiesList.add(golom);

If I do it like this it dont show the enemy on the map:


                       if(a>=10 && a<=80) race=0;
                       else if(a>80 && a<=100) race=1;
                       else if(a>=0 && a<10) race=2;                         
                         golom = new Enemy(race);
                        enemiesList.add(golom);

This is how I draw the enemy:


for(int i=0;i<enemiesList.size;i++){    

            switch (enemiesList.get(i).id) {
                case 1:
                    batch.draw(golomChar,enemiesList.get(i).x, enemiesList.get(i).y);
                    break;
                case 2:
                    batch.draw(golomChar2,enemiesList.get(i).x, enemiesList.get(i).y);
                    break;
                case 3:
                    batch.draw(golomChar3,enemiesList.get(i).x, enemiesList.get(i).y);
                    break;
            }
        }