started changing from array to db