solved the arraylist problem