replace arrayList with data in database