Used db->makeArray instead of cycle