instead of sending each object, added feature to send a arraylist