read objects to arraylist working